frame: Set GTK_OVERFLOW_HIDDEN
authornana-4 <hnmaigo@gmail.com>
Thu, 6 Aug 2020 15:54:34 +0000 (00:54 +0900)
committernana-4 <hnmaigo@gmail.com>
Thu, 20 Aug 2020 13:24:36 +0000 (22:24 +0900)
It doesn't really make sense for the frame to allow drawing children
outside of it.

gtk/gtkframe.c

index bd904a57fde79c211a72d8ba8039193646c9242f..c1542001ddda0213e311323cb74aea480018405f 100644 (file)
@@ -46,6 +46,9 @@
  * the top edge of the frame. The horizontal position of the label can
  * be controlled with gtk_frame_set_label_align().
  *
+ * GtkFrame clips its child. You can use this to add rounded corners to
+ * widgets, but be aware that it also cuts off shadows.
+ *
  * # GtkFrame as GtkBuildable
  *
  * The GtkFrame implementation of the GtkBuildable interface supports
@@ -224,6 +227,8 @@ gtk_frame_init (GtkFrame *frame)
 {
   GtkFramePrivate *priv = gtk_frame_get_instance_private (frame);
 
+  gtk_widget_set_overflow (GTK_WIDGET (frame), GTK_OVERFLOW_HIDDEN);
+
   priv->label_widget = NULL;
   priv->has_frame = TRUE;
   priv->label_xalign = 0.0;